class Graphic < ActiveRecord::Base
  attr_accessible :description, :price, :title, :product_url, :bandwidth, :energycom, :graphictype, :memcapacity, :memspeed, :pcitype, :procspeed
  acts_as_heir_of :product

  validates :description, :price, :title, :product_url, :bandwidth, :energycom, :graphictype, :memcapacity, :memspeed, :pcitype, :procspeed, presence: true
  #validates :title, uniqueness: true  ---> En la clase padre
  validates :price, numericality: {greater_than_or_equal_to: 0.01}
  validates :memcapacity, :memspeed, :procspeed, numericality: {greater_than_or_equal_to: 512}
  validates :energycom, numericality: {greater_than_or_equal_to: 5}
  validates :bandwidth, numericality: {greater_than_or_equal_to: 64}
end
